#pragma once

#include <vector>
#include <string>
#include "ConstraintEntry.h"


// ResultTable stores information about results of a query.
// The information contained in it are of the following format:
//	[the selected synonym - vector of attributes specified for the synonym - vector of result strings]
class ResultTable {
	private:
		std::vector<std::string> mSynonymVector; // synonyms as strings
		std::vector<ConstraintAttrType> mAttributeVector;
	public:
		ResultTable(void);
		~ResultTable(void);

		/// If the synonym is NOT empty, adds it and returns true.
		/// Otherwise, does nothing and returns false to indicate nothing new was added.
		bool addSynonym(std::string synonym, ConstraintAttrType type);

		
		/// If the synonym is NOT empty, assume NONE attribute and adds it and returns true
		/// Otherwise, does nothing and returns false to indicate nothing new was added.
		bool addSynonym(std::string synonym);

		// If the index exists in the table, returns the synonym at that index.
		// Otherwise, returns an empty string.
		std::string getSynonymAtIndex(int index);
		
		/// If the index exists in the table, returns the attribute requirement at that index.
		/// Otherwise, returns CONSTRAINT_ATTR_INVALID
		ConstraintAttrType getAttributeAtIndex(int index);

		// Returns the number of entries currently in the table
		int getNumberOfEntries();
		/// Replace synonym s2 with s1
		bool replaceSynonym(std::string s1, std::string s2);
};

